<me:UIWF x:Class="WPFExcelReport.TWAFARBEN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/> 
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/> 
        <ucd:Divideby1000  x:Key="d1000"/>  
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel HorizontalAlignment="Left">
            <WrapPanel>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=属性:}}"></TextBlock>
                    <Button  Grid.Column="1" Click="EditCommand" Width="24" Height="20" HorizontalAlignment="Left" Visibility="{Binding IsMaster,Converter={StaticResource bv}}" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" TabIndex="506" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >确认</TextBlock>
                </Grid>
            </WrapPanel>
            <WrapPanel> 
                <Grid VerticalAlignment="Top" Visibility="{Binding IsStock,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=最低库存}}"></TextBlock>
                    <ex:NumericBox Grid.Column="1" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  TabIndex="501"  Text="{Binding WAFRAPPH,Source={StaticResource vwMaster}}" MinWidth="40" Width="Auto" />
                    <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=起订量:}}"></TextBlock>
                    <ex:NumericBox Grid.Column="3" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"   TabIndex="502"  Text="{Binding WAFRAPPB,Source={StaticResource vwMaster}}" MinWidth="40" Width="Auto" />
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=颜色组}}"/>
                    <SD:TSSD0561 Grid.Column="1" KEY="{Binding CGRP,ElementName=TV}" IsEdit="{Binding IsEdit,ElementName=TV}" />
                    <TextBlock  Grid.Column="2"     
                                    Text="{Binding WAFPRGRP,Source={StaticResource vwMaster}}" MinWidth="40" Width="Auto" />
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=说明}}"></TextBlock>
                    <ex:TXT72  Grid.Column="1" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"   
                               Text="{Binding WAFBEZ,ElementName=TV,Converter={StaticResource gb2312}}"   Width="200" />
                    <ex:TXT72  Grid.Column="2" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"   
                               Text="{Binding WAFGRPBEZ,ElementName=TV,Converter={StaticResource gb2312}}"   Width="200" />
                    
                </Grid> 
            </WrapPanel>
        </StackPanel> 
    </Grid>
</me:UIWF>
